package com.itheima.goods.controller.admin;


import com.itheima.goods.service.WorkspaceService;
import com.itheima.goods.vo.DishOverViewVO;
import com.itheima.goods.vo.SetmealOverViewVO;
import com.itheima.vo.OrderOverViewVO;
import com.itheima.result.Result;
import com.itheima.vo.BusinessDataVO;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/workspace")
@Slf4j
@Api(tags = "工作台相关接口")
public class WorkSpaceController {

    @Autowired
    private WorkspaceService workspaceService;


    /**
     * 查询订单管理数据
     * @return
     */
    @GetMapping("/overviewOrders")
    public Result overviewOrders(){
        OrderOverViewVO order= workspaceService.overviewOrders();
        return Result.success(order);
    }

    /**
     * 查询菜品总览
     * @return
     */
    @GetMapping("/overviewDishes")
    public Result overviewDishes(){
        DishOverViewVO overViewVO=workspaceService.overviewDishes();
        return Result.success(overViewVO);
    }

    /**
     * 查询套餐总览
     * @return
     */
    @GetMapping("/overviewSetmeals")
    public Result overviewSetmeals(){
        SetmealOverViewVO vo=workspaceService.overviewSetmeals();
        return Result.success(vo);
    }

    /**
     * 查询今日运营数据
     * @return
     */
    @GetMapping("/businessData")
    public Result businessData(){
        BusinessDataVO vo=workspaceService.businessData();
        return Result.success(vo);
    }

}
